<?php
/**
 * Login_Data_Setactive
 * set active value
 *
 * @author Adrian Stolarski
 */
class Login_Data_Setactive implements Login_Data_Mainable, Login_Data_Preparable {
    
    /**
     *
     * @var type $database
     * database handler
     */
    public $database;
    /**
     *
     * @var type $database_query
     * database query handler
     */
    public $database_query;
    /**
     *
     * @var type $redirect_action
     * redirect action handler
     */
    public $redirect_action;
    
    /**
     * construct()
     */
    public function __construct() {
        $this->database = new Core_Driver_MysqlImproved;
    }
    
    /**
     * main()
     * set user account activity
     * 
     * @param array $variables
     */
    public function main(array $variables = null) {
        $this->database->connect();
        foreach($variables as $key => $value){
            $variables[$key] = $this->database->escape($value);
        }
        $this->prepare_query($variables);
        //echo $this->database_query;
        $this->database->prepare($this->database_query);
        $this->database_query();
        $this->database->dataOperations();
    }
    
    /**
     * prepare_query()
     * set new user activity
     * 
     * @param array $variables
     */
    public function prepare_query(array $variables = null) {
        //var_dump($variables);
        $this->database_query = "UPDATE user_object SET user_activity=2 WHERE user_id=".$variables['id'].";";
    }

//put your code here
}
